<script type="text/javascript">
function checkprezzo(){
		
		$('#index').append('<div id="prezzoinfo" class="info"></div>');
    	var prezzoInfo = $('#prezzoinfo');
		var ele = $('#prezzo');
		var pos = ele.offset();
		
		prezzoInfo.css({
			top: pos.top-3,
			left: pos.left+ele.width()+15
		});
		
		var prezzocifre = /^[0-1]{0,1}[0-9]{0,2}\.[0-9]{2}$/i;
		
		if(!prezzocifre.test(ele.val())) {
				prezzoInfo.removeClass('correct').addClass('error').html('&larr; Il prezzo &egrave; da inserire con il punto!<br>Inoltre dopo il punto mettere 2 cifre<br>Es:<i>12<u>.</u>34</i>').show();
				ele.removeClass('normal').addClass('wrong');					
		} else {
				prezzoInfo.removeClass('error').addClass('correct').html('&radic;').show();
				ele.removeClass('wrong').addClass('normal');
		}	
}
</script>
<?php

$query_Recordset1 = "SELECT * FROM materie order by nomemateria";
  	$Recordset1 = mysql_query($query_Recordset1, $mlu) or die(mysql_error());
  	$row_Recordset1 = mysql_fetch_assoc($Recordset1); ?>
    	<form action="/mlu/smistamento/newbook.php" method="post" name="formtitolo" id="formtitolo">
  	<table>
		<tr>
			<td>EAN</td>
    		<td><input name="ean" type="text" value="<?php echo $_SESSION['idcod']; ?>" size="32" readonly="readonly" /></td>
    	</tr>
    	<tr>
			<td>TITOLO</td>
    		<td><input type="text" name="titolo" value="" size="32" class="titolo" id="titolo"/></td>
    	</tr>
    	<tr>
			<td>AUTORI</td>
    		<td><input type="text" name="autori" value="" size="32" /></td>	
    	</tr>
    	<tr>
			<td>CASA EDITRICE</td>
    		<td><input type="text" name="casa" value="" size="32" /></td>	
    	</tr>
    	<tr>
			<td>PREZZO</td>
    		<td><input type="text" name="prezzo" value="" size="32" id="prezzo" onkeyup="checkprezzo()"/></td>
    	</tr>
    	<tr>
			<td>MATERIA</td>
    		<td><select name="idmateria">
        	<?php  do {  ?>
        		<option value="<?php echo $row_Recordset1['idmateria']?>" ><?php echo $row_Recordset1['nomemateria']?></option>
        	<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></select></td>	
    	</tr>
    	<tr>
			<td>ANNO DI PUBBLICAZIONE</td>
    		<td><input type="text" name="anno" value="" size="32" /></td>
		</tr>
	</table>
  <input name="invia dati" type="submit" id="send" value="invia dati" />
</form>

</body>
</html>